/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package net.db.generator;

import net.db.generator.utils.ClassGeneratorUtil;
import net.db.generator.field.models.BaseFieldModel;

/**
 *
 * @author abosancic
 */
public class JavaDAOBaseInterfaceWriter extends JavaDAOBaseClassWriter{
    
    public static String DAO_POSTFIX = "Impl";
    
    public JavaDAOBaseInterfaceWriter() {
        super();
    }
    
    @Override
    protected void generateClassName() {
        stringClass.append("public interface ").append(ClassGeneratorUtil.humanize(getClassName())).append("<T, PK> extends IDAOBase {\n\n");
    }
    
    @Override
    protected void generateConstructor(){
        
    }
    
    //==========================================================================
    // setters and getters
    //==========================================================================
    @Override
    public String getClassName() {
        return super.getClassName() + DAO_POSTFIX;
    }

    @Override
    protected void generateGettersAndSetters() {
        for (BaseFieldModel fieldModel : fields) {

            String field = fieldModel.getFieldName();
            String type = fieldModel.getFieldType();

            stringClass.append(spaces).append("public ").append(type).append(" ").append(ClassGeneratorUtil.humanizeToGetter(field)).append("();\n");

            stringClass.append(spaces).append("public void ").append(ClassGeneratorUtil.humanizeToSetter(field)).append("(").append(type).append(" ").append(ClassGeneratorUtil.humanizeToField(field)).append(");\n\n");
        }
    }

    @Override
    protected void generateFields() {
        
    }

    @Override
    protected void generateToString() {
        
    }

    @Override
    protected void generateHashCode() {
        
    }

    @Override
    protected void generateEquals() {
     
    }

    @Override
    public String getPrimaryKeyType() {
        return null;
    }
    
}
